import Vue from 'vue'
import VueRouter from 'vue-router'
import Swagger from "../views/back/system/Swagger";

Vue.use(VueRouter);

const routes = [



  {
    path: '/swagger',
    name: 'Swagger',
    component: () => import('../views/back/system/Swagger')
  },
  {
    path: '/login',
    name: '欢迎登录',
    component: () => import('../views/auth/Login')
  },
  {
    path: '/',
    name: '首页',
    component: () => import('../views/back/Index'),
    children: [

      {
        path: 'api',
        name: '接口同步',
        component: () => import('../views/back/system/Api')
      },
      {
        path: 'sysRole',
        name: '角色管理',
        component: () => import('../views/back/system/Role')
      },
      {
        path: 'sysPermission',
        name: '权限管理',
        component: () => import('../views/back/system/Permission')
      },
      {
        path: 'codeBuilder',
        name: '代码生成',
        component: () => import('../views/back/system/CodeBuilder')
      },
      {
        path: 'sysUser',
        name: '用户管理',
        component: () => import('../views/back/system/User')
      },
      {
        path: 'sysUserRole',
        name: '分配角色',
        component: () => import('../views/back/system/UserRole')
      },
      {
        path: 'sysMenu',
        name: '菜单管理',
        component: () => import('../views/back/system/Menu')
      },
      {
        path: 'sysDictionary',
        name: '数据字典',
        component: () => import('../views/back/system/Dictionary')
      },
      {
        path: 'sysDictionaryGroup',
        name: '字典详情',
        component: () => import('../views/back/system/DictionaryGroup')
      },
      {
        path: 'sysRoleMenu',
        name: '分配菜单',
        component: () => import('../views/back/system/RoleMenu')
      },
      {
        path: 'person',
        name: '个人中心',
        component: () => import('../views/back/system/Person')
      },
      {
        path: 'changePwd',
        name: '修改密码',
        component: () => import('../views/back/system/ChangePwd')
      },
      {
        path: 'log-sql',
        name: 'sql日志',
        component: () => import('../views/back/log/log-sql')
      },
      {
        path: 'log-operator',
        name: '操作日志',
        component: () => import('../views/back/log/log-operator')
      },
      {
        path: 'sql-detail',
        name: 'sql日志详情',
        component: () => import('../views/back/log/sql-detail')
      },
    ]
  },
  {
    path: '*',
    name: '404错误页面',
    component: () => import('../views/error/Error404')
  }
];

const router = new VueRouter({
  routes
});

export default router
